﻿#ifndef C3FDANALYSISWIDGET_H
#define C3FDANALYSISWIDGET_H

#include "mainWidgetsAPI.h"
#include <QWidget>
#include <QTreeWidgetItem>
#include "Common/C3fdProject.h"
#include "Common/C3fdCase.h"

namespace Ui
{
	class C3fdAnalysisWidget;
}

namespace GUI
{
	class MainWindow;
}
namespace MainWidget
{

	class MAINWIDGETSAPI C3fdAnalysisWidget : public QWidget
	{
		Q_OBJECT

	public:
		explicit C3fdAnalysisWidget(GUI::MainWindow *mainwindow, QWidget *parent = 0);
		~C3fdAnalysisWidget();

		void reTranslate();
		void initWorkingConditionsList();
	signals:
		void displaySolveParameter(QTreeWidgetItem *, bool isFirst);

	public slots:
		void on_pb_Add_clicked();
		void on_pb_Remove_clicked();
		void on_pb_Rename_clicked();
		void itemClickedSlot(QTreeWidgetItem *, int);
		void itemNameChangedSlot(QTreeWidgetItem*, QString, QString, QString);

	private:
		bool addWorkingCondition(QString name);
		bool renameWorkingCondition(QString oldName, QString newName);
		bool deleteWorkingCondition(QString name);
	private:
		Ui::C3fdAnalysisWidget *m_Ui = nullptr;
		Common::C3fdProject *m_Project = nullptr;
		Common::C3fdCase *m_CurrentCase = nullptr;
	};

}

#endif // C3FDANALYSISWIDGET_H
